home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip Aralık 2001.iso / prog / winxp / rsjcd / setup.exe / cdwacc.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-24  |  18.5 KB  |  385 lines

  1. /******************************************************************************
  2.  
  3.   cdwacc.h
  4.  
  5.   Purpose:     CD Writer Access library header file
  6.  
  7.   Author:      MM, RSJ Software
  8.  
  9.   Date:        04/98
  10.  
  11.   Copyright (c) 1997-2001 by RSJ Software GmbH, Germering.
  12.   All rights reserved.
  13.  
  14. ******************************************************************************/
  15.  
  16. #ifndef _CDWACC_H_
  17. #define _CDWACC_H_
  18.  
  19. #ifdef __cplusplus
  20.   extern "C" {
  21. #endif
  22.  
  23. #pragma pack(1)
  24.  
  25. /*------- defines -----------------------------------------------------------*/
  26.  
  27. /*******************************************************************************
  28.   'CDWACCRET' defines all available return codes from calls to the CD library
  29.   functions (such as the track copy library).
  30.  
  31.   NOTES: CDWACCRET is not defined as an enum to allow using these constants
  32.    together with resource compilers and alike.
  33.  
  34.    Although defined in groups, expect each error to be returned by
  35.    any call.
  36. *******************************************************************************/
  37.  
  38. #define CDWACC_OK                  0   /* no error */
  39.  
  40. /* general errors */
  41. #define CDWACC_FAILED_TO_OPEN      1   /* failed to open VXD */
  42. #define CDWACC_INVALID_PARM        2   /* invalid parameter was passed */
  43.  
  44. /* opening the device */
  45. #define CDWACC_DEVICE_NOT_FOUND  100   /* device could not be found */
  46. #define CDWACC_FILE_NOT_FOUND    101   /* file could not be found (cdfile) */
  47. #define CDWACC_PATH_NOT_FOUND    102   /* path could not be found (cdfile) */
  48. #define CDWACC_ACCESS_DENIED     103   /* access denied for some reason */
  49. #define CDWACC_DEVICE_LOCKED     104   /* device locked by another process */
  50. #define CDWACC_INVALID_DEVICE    105   /* invalid device type */
  51. #define CDWACC_INVALID_DRIVER    106   /* driver module in error */
  52. #define CDWACC_NOT_READY         107   /* device not ready */
  53. #define CDWACC_OUTOFMEM          108   /* out of memory */
  54.  
  55. /* working with the device */
  56. #define CDWACC_ARENA_TRASHED     200   /* internal control structures damaged */
  57. #define CDWACC_INVALID_HANDLE    201   /* invalid device handle */
  58. #define CDWACC_INVALID_FUNC      202   /* invalid function */
  59. #define CDWACC_INVALID_DATA      203   /* invalid data for function */
  60. #define CDWACC_NOT_SUPPORTED     204   /* function not supported */
  61. #define CDWACC_IOCTL_ERROR       205   /* generic IOCtl error */
  62. #define CDWACC_UNIT_ATTENTION    206   /* illegal medium change */
  63. #define CDWACC_RECORDER_BUSY     207   /* recorder cannot process the requested
  64.                                           command at this time */
  65. #define CDWACC_INTERRUPTED       208   /* the command has been interrupted */
  66. #define CDWACC_NOBLANKIFCHANGED  209   /* CD has been modified in current session
  67.                                             and cannot be blanked; close it first */
  68.  
  69. /* reading and writing */
  70. #define CDWACC_WRITE_PROTECT     300   /* medium and/or device write protected */
  71. #define CDWACC_DISK_FULL         301   /* disk full */
  72. #define CDWACC_CRC_ERROR         302   /* data error (read or write) */
  73. #define CDWACC_SEEK_ERROR        303   /* sector address out of range */
  74. #define CDWACC_READ_ERROR        304   /* logical read error */
  75. #define CDWACC_WRITE_ERROR       305   /* logical write error */
  76. #define CDWACC_GEN_FAILURE       306   /* general failure */
  77. #define CDWACC_FLUSH_FAILED      307   /* FLUSH CACHE command failed, but drive is not in write mode anymore */
  78.  
  79. /* copying tracks */
  80. #define CDWACC_BUFFER_UNDERRUN   400   /* data could not be written in time */
  81. #define CDWACC_COPY_ABORTED      401   /* operator has cancelled the copy operation */
  82. #define CDWACC_BUFFER_OVERFLOW   402   /* audio data could not be read in time */
  83.  
  84. /* file system errors */
  85. #define CDWACC_INVALID_FORMAT    500   /* invalid file system format */
  86. #define CDWACC_NO_MORE_HANDLES   501   /* no more handles available (out of memory) */
  87. #define CDWACC_NO_MORE_FILES     502   /* no more files in this directory */
  88. #define CDWACC_INVALID_DIRECTORY 503   /* invalid directory in path name */
  89. #define CDWACC_DIR_NOT_EMPTY     505   /* directory is not empty (rmdir) */
  90. #define CDWACC_NEGATIVE_SEEK     506   /* negative seek offset */
  91. #define CDWACC_SHARING_VIOLATION 507   /* file already used by someone else */
  92. #define CDWACC_ADDRESS_CHANGED   508   /* locked cache file or write handle could not be written at the predetermined address */
  93. #define CDWACC_CACHE_FULL        509   /* the 2nd-level cache is full */
  94. #define CDWACC_FILE_TOO_SMALL    510   /* file is to small to be copied directly (use standard copy algorithm instead) */
  95.  
  96. /* use a generic data type to prevent sizeof() trouble */
  97. typedef short CDWACCRET;
  98.  
  99. #define CDWACCLNK  extern CDWACCRET __stdcall
  100.  
  101. /*------- typedefs ----------------------------------------------------------*/
  102. /******************************************************************************
  103.   NOTE:
  104.   All structures have a 'cb' member wich must hold the size of the structure
  105.   before calling any function.
  106. ******************************************************************************/
  107.  
  108. /******************************************************************************
  109.   DRVMAP
  110.   receives all drive letters handled by the RSJ CD Writer Filesystem
  111.   (i.e. if DRVMAP contains 'DEF' drives D:, E: and F: are CDWFS drives)
  112. ******************************************************************************/
  113. typedef char  DRVMAP[25];
  114.  
  115. /******************************************************************************
  116.   'CDWACC_FINALIZE_MODE' defines the various modes available for the
  117.   'cdwFinalize' function.
  118. ******************************************************************************/
  119. typedef enum {
  120.   CDWACC_FINALIZE_NONE,          /* just detach drive
  121.                                     (no data written, no buffers flushed!) */
  122.   CDWACC_FINALIZE_CACHE,         /* write cache buffer to disk -
  123.                                     not needed anymore (only for compatibility
  124.                                     reasons) */
  125.   CDWACC_FINALIZE_DIRECTORY,     /* write cache buffer + directory to disk */
  126.   CDWACC_FINALIZE_SESSION,       /* write PVD + session header to disk */
  127.   CDWACC_FINALIZE_SEAL           /* like FLUSH_SESSION, but make CD read-only */
  128.   } enum_CDWACC_FINALIZE_MODE;
  129.  
  130. /* use a short to prevent sizeof(enum) differences */
  131. typedef short CDWACC_FINALIZE_MODE;
  132.  
  133. /*******************************************************************************
  134.   'CDWACC_TRACK_MODE' defines all available track modes.
  135. *******************************************************************************/
  136. typedef enum {
  137.   CDWACC_TM_MODE1 = 0x01,        /* CDROM, 2048 bytes, ECC */
  138.   CDWACC_TM_MODE2 = 0x02         /* CD XA, 2048-2324 bytes */
  139.   } enum_CDWACC_TRACK_MODE;
  140.  
  141. /* use a short to prevent sizeof(enum) differences */
  142. typedef short CDWACC_TRACK_MODE;
  143.  
  144.  
  145. /******************************************************************************
  146.   'CDWACC_CD_INFO' contains information about the CD. This includes
  147.   track/session information, information about the number of files and
  148.   directories on the CD
  149.  
  150.   Used by the 'cdwGetCDInfo ' function
  151.  
  152.   NOTE: We're using longs for all fields to prevent problems with languages
  153.         like Visual Basic
  154. ******************************************************************************/
  155. typedef struct {
  156.   long    cb;                   /* size of structure */
  157.   long    file_count;           /* number of files on the CD */
  158.   long    dir_count;            /* number of directories on the CD */
  159.   long    file_disk_usage;      /* volume space occupied by files */
  160.   long    dir_disk_usage;       /* volume space occupied by directories */
  161.  
  162.   long    finalized_sessions;   /* number of finalized sessions on the CD */
  163.   long    open_session;         /* currently open session */
  164.   long    track_count;          /* number of tracks on the CD */
  165.   long    reserved_track;       /* currently reserved track */
  166.   long    fixation_recommended; /* power calibration area almost full */
  167.   long    modified;             /* CD has been modified */
  168.  
  169.   } CDWACC_CD_INFO;
  170.  
  171. /******************************************************************************
  172.   'CDWACC_VOL_INFO'
  173.   not needed yet since setting and retrievinbg volume information is not
  174.   yet supported
  175.   this will be added in a future release
  176. ******************************************************************************/
  177. typedef struct {
  178.   unsigned short cb;            /* size of structure */
  179.   } CDWACC_VOL_INFO;
  180.  
  181. /*******************************************************************************
  182.   'CDWACC_FSPARMS' contains general information about the file system status
  183.   and its environment.
  184.  
  185.   NOTE: We're using longs for all fields to prevent problems with languages
  186.         like Visual Basic
  187. *******************************************************************************/
  188. typedef struct {
  189.   long                cb;         /* size of structure */
  190.  
  191.   /* parameters which can be modified anytime */
  192.   long                debug;      /* print debug messages */
  193.   long                eject;      /* eject CD after finalizing */
  194.   long                nolock;     /* don't lock drive door while
  195.                                      CD is mounted */
  196.   long                speed;      /* speed factor (1 = 150K, 2 = 300K, ...) */
  197.   long                emulation;  /* emulation write */
  198.   long                nozap;      /* prevent overwriting or deleting files
  199.                                      not implemented yet in Win95 */
  200.   long                tmode;      /* track mode for next track */
  201.   long                iso_level;  /* ISO9660 Information Interchange Level
  202.                                      (determines how ISO9660 filenames are built
  203.                                       when closing the CD) */
  204.  
  205.   /* parameters which can only be changed during 'fsMount()' */
  206.   unsigned long       cache_1;     /* size of RAM cache (in KB) */
  207.   unsigned long       cache_2;     /* size of second level cache
  208.                                       (ignored on Windows systems) */
  209.   char                cache_path[260];
  210.                                    /* path where the 2nd-level cache
  211.                                        files will be placed
  212.                                        (ignored on Windows systems) */
  213.  
  214.   /* parameters which can only be read */
  215.   long                ver_major;  /* major file system version number */
  216.   long                ver_minor;  /* minor file system version number */
  217.  
  218.   } CDWACC_FSPARMS;
  219.  
  220. /*******************************************************************************
  221.   'CDWACC_DEV_TYPE' defines all supported CD device types.
  222. *******************************************************************************/
  223. typedef enum {
  224.   CDWACC_DVT_CDROM,                        /* CDROM drive */
  225.   CDWACC_DVT_CDREC,                        /* CD recorder */
  226.   CDWACC_DVT_CDRW,                         /* CD recorder with RW capabilities */
  227.   CDWACC_DVT_HD                            /* hard disk (CDR emulation)
  228.                                                 (not used with the file system) */
  229.   } enum_CDWACC_DEV_TYPE;
  230.  
  231. /* use a long to prevent sizeof(enum) differences */
  232. typedef long CDWACC_DEV_TYPE;
  233.  
  234.  
  235. /*******************************************************************************
  236.   'CDWACC_DEV_CAPS' contains information about the device capabilities.
  237.   NOTE: We're using longs for all fields to prevent problems with languages
  238.         like Visual Basic
  239. *******************************************************************************/
  240.  
  241. /*-------- TAO/DAO support bits (set in 'writable') --------------------------*/
  242. #define CDWACC_TAO_SUPPORTED     0x01
  243. #define CDWACC_DAO_SUPPORTED     0x02
  244.  
  245. typedef struct {
  246.   long        cb;                 /* size of structure */
  247.   long        removable;          /* device uses removable media */
  248.   long        writable;           /* device is able to write data;
  249.                                    * also contains TAO/DAO bits */
  250.   long        session;            /* device supports (or needs) sessions */
  251.   long        rmtrack;            /* device can remove single tracks */
  252.  
  253.   /* audio parameters are not used with the file system */
  254.   long        read_audio;         /* device can read audio tracks */
  255.   long        play_audio;         /* device can play audio tracks */
  256.  
  257.   long        speed_count;        /* number of possible speeds */
  258.   long        speed_table[20];    /* array with possible recording speed factors */
  259.  
  260.   long        dev_type;           /* type of CD recorder */
  261.  
  262.   } CDWACC_DEV_CAPS;
  263.  
  264.  
  265. #pragma pack()
  266.  
  267.  
  268. /*------- function prototypes -----------------------------------------------*/
  269. /******************************************************************************
  270.  
  271.   NOTES:
  272.   Most functions expect a drive as input parameter. This should be in the
  273.   format "<drive_letter>:" (not case sensitive)
  274.   for example
  275.        F:
  276.  
  277. ******************************************************************************/
  278.  
  279. /******************************************************************************
  280.   'cdwGetDriveLetters' returns the drive letters handled by the CD Writer File
  281.   system in a character array.
  282.   (i.e. if DRVMAP contains 'DEF' then drives D:, E: and F: are CDWFS drives)
  283. ******************************************************************************/
  284. CDWACCLNK      cdwGetDrvLetters      (DRVMAP drvmap);
  285.  
  286. /******************************************************************************
  287.   'cdwGetDevCaps' retrieves the device capabilites of a CDWFS drive
  288.   see description of the CDWACC_DEV_CAPS structure for more details
  289. ******************************************************************************/
  290. CDWACCLNK      cdwGetDevCaps         (char *drive_ltr,
  291.                                       CDWACC_DEV_CAPS *dev_caps);
  292.  
  293. /******************************************************************************
  294.   'cdwGetParms' returns the current file system settings. These settings
  295.   are also displayed in the drives' property sheet (in "My Computer")
  296. ******************************************************************************/
  297. CDWACCLNK      cdwGetParms           (char *drive_ltr,
  298.                                       CDWACC_FSPARMS *pfsparms);
  299.  
  300. /******************************************************************************
  301.   'cdwSetParms' sets the new file system settings. These settings are stored
  302.   as default values for the drive specified (remain after reboot)
  303. ******************************************************************************/
  304. CDWACCLNK      cdwSetParms           (char *drive_ltr,
  305.                                       CDWACC_FSPARMS *pfsparms);
  306.  
  307. /******************************************************************************
  308.   'cdwFormat' formats a new CD
  309.   THIS IS AN OBSOLETE FUNCTION and does not need to be called anymore
  310. ******************************************************************************/
  311. CDWACCLNK      cdwFormat             (char *drive_ltr);
  312.  
  313. /******************************************************************************
  314.   'cdwUnseal' removes the write protection from a sealed CD (a CD closed with
  315.   the CDWACC_UMOUNT_SEAL mode)
  316. ******************************************************************************/
  317. CDWACCLNK      cdwUnseal             (char *drive_ltr);
  318.  
  319. /******************************************************************************
  320.   'cdwEraseCDRW' erases a CD-RW completely.
  321.   There must be no open/modified sessions on the CD before executing this
  322.   command
  323. ******************************************************************************/
  324. CDWACCLNK      cdwEraseCDRW          (char *drive_ltr);
  325.  
  326. /******************************************************************************
  327.   'cdwGetCDInfo' retrieves information about a CD that can be used for
  328.   displaying a chkdsk result etc.
  329. ******************************************************************************/
  330. CDWACCLNK      cdwGetCDInfo          (char *drive_ltr,
  331.                                       CDWACC_CD_INFO *pcdinfo,
  332.                                       CDWACC_VOL_INFO *should_be_NULL,
  333.                                       long *free_space,
  334.                                       long *disk_space);
  335.  
  336. /******************************************************************************
  337.   'cdwUmount' closes the current session.
  338.   For available modes, see the CDWACC_UMOUNT_MODE enumeration above
  339.   NOTE:
  340.   This function does not return an error if the drive specified is
  341.   currently not mounted (or no CD inserted)
  342. ******************************************************************************/
  343. CDWACCLNK      cdwUmount             (char *drive_ltr,
  344.                                       CDWACC_FINALIZE_MODE  mode,
  345.                                       CDWACC_VOL_INFO *should_be_NULL);
  346.  
  347. /******************************************************************************
  348.   'cdwGetVersion' returns version information for this library.
  349.   To retrieve the file system version, use the 'cdwGetFSParms' command
  350. ******************************************************************************/
  351. CDWACCLNK      cdwGetVersion         (BYTE *major, BYTE *minor);
  352.  
  353.  
  354. /******************************************************************************
  355.   'cdwEjectMedium' ejects the medium in the specifed drive
  356. ******************************************************************************/
  357. CDWACCLNK      cdwEjectMedium        (char *drv_ltr);
  358.  
  359.  
  360. /******************************************************************************
  361.   'cdwSetBootFile' makes a CD bootable. 'boot_image_file' must be located
  362.   on the CD before calling this function.
  363. ******************************************************************************/
  364. CDWACCLNK      cdwSetBootfile        (char *drive_ltr,
  365.                                       char *boot_image_file);
  366.                                       
  367. /******************************************************************************
  368.   'cdwQueryCacheStatus' returns information about the current file system
  369.   cache usage
  370.   NOTE: Currently, the unit used for 'cache_size' and 'cache_status'
  371.         depends on the recorder driver, so this information is useful
  372.         for percent-like calculations only.
  373.         Example:
  374.          filled_percent = used_cache / cache_size * 100 
  375. ******************************************************************************/
  376. CDWACCLNK      cdwQueryCacheStatus   (char *drive_ltr,
  377.                                       unsigned long *cache_size,
  378.                                       unsigned long *used_cache);
  379.  
  380.  
  381. #ifdef __cplusplus
  382. }
  383. #endif
  384.  
  385. #endif /* _CDWACC_H_ */